import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { resolve } from "path"
import vitePluginImp from 'vite-plugin-imp'

// https://vitejs.dev/config/
export default defineConfig({
	plugins: [
		react(),
		vitePluginImp({
			libList: [
				{
					libName: "antd",
					style: (name) => `antd/es/${name}/style`,
				},
			],
		})

	],
	// 配置路径别名
	resolve: {
		alias: {
			"@": resolve(__dirname, "src"),
		},
	},
	css: {
		// 全局配置scss
		preprocessorOptions: {
			scss: {
				additionalData: '@import"./src/assets/style/main.scss";'
			},
			less: {
				javascriptEnabled: true,
			}
		}
	},
})